package model

import (
	"zsc-boot/app/system_layer/model"
	"zsc-boot/core/orm"
)

type Message struct {
	orm.Model
	ReceiverId   int                     `json:"receiverId" gorm:"column:receiver_id;comment:接收者id"`
	SenderId     int                     `json:"senderId" gorm:"column:sender_id;comment:发送者id"`
	ReceiverInfo model.ServiceUserSimple `json:"receiverInfo" gorm:"foreignKey:ReceiverId"`
	SenderInfo   model.ServiceUserSimple `json:"senderInfo" gorm:"foreignKey:SenderId"`
	IsRead       bool                    `json:"isRead" gorm:"column:is_read;comment:是否已读;default:false"`
	Content      string                  `json:"content" gorm:"column:content;comment:内容;default:''"`
}

func (Message) TableName() string {
	return "message"
}

func (Message) TableComment() string {
	return "消息表"
}
